﻿@model IEnumerable<DslamPort.Models.UserModel>        
<!--Body-->
<div align="center">
    <h1>
        QUẢN TRỊ NGƯỜI DÙNG</h1>
</div>
<div class="container_12">
    <div class="grid_12">
        <!-- Notification boxes -->
        @if (TempData["msg"] != null)
        {                            
            <span class="notification n-success">@TempData["msg"]</span>
        }
        <div class="bottom-spacing">
            <!-- Button -->
            <div class="float-right">
                <a href="@Url.Action("AddUser", "User")" class="button"><span>Thêm mới
                    <img src="@Url.Content("~/Content/Body/Images/plus-small.gif")"  width="12" height="9" alt="Thêm mới" /></span>
                </a>
            </div>
        </div>
        <!-- Example table -->
        @using (Html.BeginForm("CheckedAction", "User", FormMethod.Post, new { id = "CheckedAction", name = "CheckedAction" }))
        {           
            <div class="module">
                <h2>
                    <span>@*Sample table*@</span></h2>
                <div class="module-table-body">
                    <div class="scrolling">
                        <div class="data-table" style="width: 150%">
                            <table id="myTable" class="tablesorter">
                                <thead>
                                    <tr>
                                        <th style="width: 5%;">
                                        </th>
                                        @*<th style="width: 1%;">
                                        </th>*@
                                        <th style="width: 4%;">
                                            STT
                                        </th>
                                        <th>
                                            Tên đăng nhập
                                        </th>
                                        <th>
                                            Mật khẩu
                                        </th>
                                        <th>
                                            Trạng thái
                                        </th>
                                        <th>
                                            Tên đơn vị
                                        </th>
                                        <th>
                                            Họ tên
                                        </th>
                                        @*<th style="width:130px;">Họ tên</th>*@
                                    </tr>
                                </thead>
                                <tbody>
                                    @{int stt = 0;}
                                    @foreach (var item in Model)
                                    {
                                        stt++;
                                        <tr>
                                            <td>
                                                <a href="@Url.Action("DeleteUser", "User", new { id = item.id })" onclick="return confirm('Bạn muốn xóa người dùng này?');" title="Xóa thông tin">
                                                    <img src="@Url.Content("~/Content/Body/Images/cross-on-white.gif")" width="16" height="16" alt="delete" /></a>&nbsp;&nbsp;&nbsp;
                                                <a href="@Url.Action("EditUser", "User", new { id = item.id })" title="Sửa thông tin">
                                                    <img src="@Url.Content("~/Content/Body/Images/pencil.gif")"  width="16" height="16" alt="edit" /></a>&nbsp;&nbsp;&nbsp;
                                            </td>
                                            @*<td class="align-center">
                                                <input type="checkbox" name="Items" id="Items[]" value="@item.user_name"/>
                                            </td>*@
                                            <td class="align-center">@stt
                                            </td>
                                            <td>@Html.DisplayFor(modelItem => item.user_name)
                                            </td>
                                            <td>@Html.DisplayFor(modelItem => item.password)
                                            </td>
                                            @if (item.status == "0")
                                            { 
                                                <td>
                                                    Khóa
                                                </td>
                                            }
                                            else
                                            {
                                                <td>
                                                    Bình thường
                                                </td>
                                            }
                                            <td>@Html.DisplayFor(modelItem => item.ten_qh)
                                            </td>
                                            <td>@Html.DisplayFor(modelItem => item.ho_ten)
                                            </td>
                                        </tr>
                                    }
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="pager" id="pager">
                        <div>
                            <img class="first" src="@Url.Content("~/Content/Body/Images/arrow-stop-180.gif")"  alt="first"/>
                            <img class="prev" src="@Url.Content("~/Content/Body/Images/arrow-180.gif")" alt="prev"/>
                            <input type="text" class="pagedisplay input-short align-center" />
                            <img class="next" src="@Url.Content("~/Content/Body/Images/arrow.gif")" alt="next"/>
                            <img class="last" src="@Url.Content("~/Content/Body/Images/arrow-stop.gif")" alt="last"/>
                            <select class="pagesize input-short align-center">
                                <option value="20" selected="selected">20</option>
                                <option value="30">30</option>
                                <option value="40">40</option>
                            </select>
                        </div>
                    </div>
                    @*<div class="table-apply"> 
                        <div class="float-right">
                            <a style='cursor:pointer' onclick="return CheckItem();" class="button">
                                <span>Xóa chọn</span>
                            </a>
                        </div>                   
                        <div>
                            <span>Chọn hành động:</span> 
                            <select class="input-medium" onchange="return CheckItem();">
                                <option value="0" id="option_0">Chọn...</option>
                                <option value="1" id="option_1">Xóa</option>                                
                            </select>
                        </div>                       
                    </div>*@
                    <div style="clear: both">
                    </div>
                </div>
                <!-- End .module-table-body -->
            </div> <!-- End .module --> 
        }
    </div>
    <!-- End .grid_12 -->
    <div style="clear: both;">
    </div>
</div>
<!-- End .container_12 -->
<!----------------------------------------------------------------->
